home *** CD-ROM | disk | FTP | other *** search
/ mail.altrad.com / 2015.02.mail.altrad.com.tar / mail.altrad.com / TEST / office deutch / ACCESS.NL-NL / ACCLR.CAB / ADO210.CHM_0001_1043 / stylesheets / vs70.js < prev    next >
Text File  |  2006-06-19  |  37KB  |  1,303 lines

  1. // VERSION 9268
  2. // This script works best with IE 6.x
  3.  
  4. //************************** LOCALIZATION VARIABLES ***************************
  5.  
  6. // Variables for Feedback links
  7. var L_FeedbackLink_TEXT = "Send feedback to Visual Studio";
  8. var L_MessageLink_TEXT = "Microsoft Knowledgebase Link";
  9. var L_MailToLink_TEXT = "Send feedback to Visual Studio";
  10.  
  11. // Variables for the running head buttons
  12. var L_SeeAlso_TEXT = "See Also";
  13. var L_Requirements_TEXT = "Requirements";
  14. var L_QuickInfo_TEXT = "QuickInfo";
  15. var L_FilterTip_TEXT = "Language Filter";    // tooltip for language button
  16. var L_Language_TEXT = "Language";        // heading for menu of programming languages
  17. var L_ShowAll_TEXT = "Show All";        // label for 'show all languages' menu item
  18.  
  19. // Variable for Animation text
  20. var L_Animation_Text = "Click to animate";
  21.  
  22. // Variables for Expand-Collapse functions
  23. var L_ExpandAll_TEXT = "Expand All";
  24. var L_CollapseAll_TEXT = "Collapse All";
  25. var L_ExColl_TEXT = "Click to Expand or Collapse";
  26.  
  27. //*************************** END LOCALIZATION ********************************
  28.  
  29. // defines the running head popup box
  30. var L_PopUpBoxStyle_Style = "WIDTH:200PX; PADDING:5px 7px 7px 7px; BACKGROUND-COLOR:#FFFFCC; BORDER:SOLID 1 #999999; VISIBILITY:HIDDEN; POSITION:ABSOLUTE; TOP:0PX; LEFT:0PX; Z-INDEX:2;";
  31.  
  32. //**** Do not localize the following lines, they allow for bilingual files ****
  33.  
  34. var US_See_Also = "See Also";
  35. var US_Requirements = "Requirements";
  36. var US_QuickInfo = "QuickInfo"
  37.  
  38. //***ScriptSettings
  39. var bRefTips = "True"        //Show RefTips
  40.  
  41. //***************************** END VARIABLES *********************************
  42.  
  43. var popOpen, theImg, theDiv, e;
  44. var imgArray = new Array(new Image(), new Image(), new Image(), new Image(), new Image());
  45.  
  46. // ****************************************************************************
  47. // *                           Common code                                    *
  48. // ****************************************************************************
  49.  
  50. // Check for <meta Name="ScriptSettings" RefTips="False">
  51.     if (bRefTips=="True"){
  52.         var mColl = document.all.tags("MeTa");
  53.         for (i=0; i<mColl.length; i++){
  54.             if (mColl(i).name.toUpperCase()=="SCRIPTSETTINGS"){
  55.                 if (mColl(i).RefTips.toUpperCase()=="FALSE") bRefTips = "False";
  56.             }
  57.         }
  58.     }
  59. var ie4 = false;
  60. var advanced = false;
  61. var curLang = null;
  62. var showAll = true;
  63. var cook = null;
  64. var baseUrl = document.scripts[document.scripts.length - 1].src.replace(/[^\/\\]+.js/, "");
  65. var popupDIV = "<DIV ID='popUpWindow' STYLE='"+L_PopUpBoxStyle_Style+"'>" + "</DIV>";
  66.  
  67. if (navigator.appName == "Microsoft Internet Explorer") {
  68.     var ver = navigator.appVersion;
  69.     var v = new Number(ver.substring(0,ver.indexOf(".", 0)));
  70.     if (v >= 4) {
  71.         advanced = true;
  72.         ie4 = true;
  73.  
  74.         // Look for 5.x buried somewhere in the version string.
  75.         var toks = ver.split(/[^0-9.]/);
  76.         if (toks) {
  77.             for (var i = 0; i < toks.length; i++) {
  78.                 var tok = toks[i];
  79.                 if (tok.indexOf(".", 0) > 0) {
  80.                     if (tok >= 5)
  81.                         ie4 = false;
  82.                 }
  83.             }
  84.         }
  85.     }
  86. }
  87. if (advanced)
  88.     window.onload = bodyOnLoad;
  89.     window.onbeforeprint = set_to_print;
  90.     window.onafterprint = reset_form;
  91.  
  92.  
  93. function finishOnLoad(){
  94.     document.onkeypress = ieKey;
  95.     window.onresize = closeIE4;
  96.     document.body.onclick = bodyOnClick;
  97.     //IF THE USER HAS IE4+ THEY WILL BE ABLE TO VIEW POPUP BOXES
  98.     if (advanced){
  99.         document.body.insertAdjacentHTML('beforeEnd', popupDIV);
  100.     }
  101. return;}
  102.  
  103.  
  104. function bodyOnClick(){
  105.     if (advanced) {
  106.         var elem = window.event.srcElement;
  107.         for (; elem; elem = elem.parentElement) {
  108.             if (elem.id == "reftip")
  109.                 return;
  110.         }
  111.         hideTip();
  112.         closeMenu();
  113.         hideSeeAlso();
  114.         resizeBan();
  115.     }
  116. }
  117.  
  118.  
  119. function ieKey(){
  120.     if (window.event.keyCode == 27){
  121.         hideTip();
  122.         closeMenu();
  123.         hideSeeAlso();
  124.         resizeBan();
  125.         closeIE4();
  126.     }
  127. return;}
  128.  
  129.  
  130. function closeIE4(){
  131.     document.all.popUpWindow.style.visibility = "hidden";
  132.     popOpen = false;
  133.     resizeBan();  //also resize the non-scrolling banner
  134. return;}
  135.  
  136.  
  137. function bodyOnLoad(){
  138.     if (advanced) {
  139.         var address = location.href;
  140.         var bookmarkStart = address.indexOf("#")
  141.         // If it has a bookmark, check to see if Language is near A Name
  142.         if (bookmarkStart>-1){
  143.             var bookmark = address.substring(bookmarkStart+1);
  144.             curLang = findLanguage(bookmark);
  145.         }
  146.         else {
  147.             // Check the context window for current language.
  148.             var cLang;
  149.             try{
  150.                 for (i=1; i< window.external.ContextAttributes.Count; i++){
  151.                     if(window.external.ContextAttributes(i).Name.toUpperCase()=="DEVLANG"){
  152.                         var b = window.external.ContextAttributes(i).Values.toArray();
  153.                         cLang = b[0].toUpperCase();
  154.                     }
  155.                 }
  156.             }
  157.             catch(e){}
  158.             if (cLang != null){
  159.                 if (cLang.indexOf("VB")!=-1) curLang = "Visual Basic";
  160.                 if (cLang.indexOf("VC")!=-1) curLang = "C++";
  161.                 if (cLang.indexOf("C#")!=-1) curLang = "C#";
  162.             }
  163.  
  164.             if (curLang == null){
  165.                 var l = "";
  166.                 var multipleLang = false;
  167.                 // Check to see what the help filter is set to.
  168.                 try {l = window.external.Help.FilterQuery.toUpperCase();}
  169.                 catch(e){}
  170.                 if (l.indexOf("VISUAL BASIC")!=-1){
  171.                     cLang = "Visual Basic";
  172.                     }
  173.                 if (l.indexOf("VISUAL C++")!=-1){
  174.                     if (cLang!=null) multipleLang = true;
  175.                     cLang = "C++";
  176.                     }
  177.                 if (l.indexOf("C#")!=-1){
  178.                     if (cLang!=null) multipleLang = true;
  179.                     cLang = "C#";
  180.                     }
  181.                 if (multipleLang==false) curLang = cLang;
  182.                 
  183.             }
  184.         }
  185.         if (curLang != null)
  186.             showAll = false;
  187.         initLangs();
  188.         resizeBan();
  189.         if (bRefTips=="True") initReftips();
  190.         initSeeAlso();
  191.     }
  192. finishOnLoad();
  193.  
  194. }
  195.  
  196.  
  197. function findLanguage(bookmark){
  198. // Find span associated with bookmark
  199.     var found = false
  200.     var aColl = document.all.tags("A");
  201.     for (i=0; i<aColl.length; i++){
  202.         if (aColl(i).name.toUpperCase()==bookmark.toUpperCase()){
  203.             var elem = null
  204.             for(t = 1; t<4; t++){
  205.                 elem = document.all(aColl(i).sourceIndex + t);
  206.                 if (elem.tagName.toUpperCase()=="SPAN")
  207.                     found = true;
  208.                     break;
  209.             }
  210.             break;
  211.         }
  212.     }
  213. //if found, filter language
  214.     if (found){
  215.         var lang = elem.innerText
  216.         return lang.substring(lang.indexOf("[") + 1, lang.indexOf("]"));
  217.     }
  218. }
  219.  
  220.  
  221. // ****************************************************************************
  222. // *                        Language filtering                                *
  223. // ****************************************************************************
  224.  
  225. function initLangs(){
  226.     var hdr = document.all.hdr;
  227.     if (!hdr)
  228.         return;
  229.  
  230.     var langs = new Array;
  231.     var spans = document.all.tags("SPAN");
  232.     if (spans) {
  233.         var iElem = spans.length;
  234.         for (iElem = 0; iElem < spans.length; iElem++) {
  235.             var elem = spans[iElem];
  236.             if (elem.className == "lang") {
  237.  
  238.                 // Update the array of unique language names.
  239.                 var a = elem.innerText.split(",");
  240.                 for (var iTok = 0; iTok < a.length; iTok++) {
  241.                     if (a[iTok]=="[A]"){
  242.                         langs[0]="A";
  243.                         elem.parentElement.outerText="";
  244.                     }
  245.                     var m = a[iTok].match(/([A-Za-z].*[A-Za-z+#0-9])/);
  246.                     if (m) {
  247.                         var iLang = 0;
  248.                         while (iLang < langs.length && langs[iLang] < m[1])
  249.                             iLang++;
  250.                         if (iLang == langs.length || langs[iLang] != m[1]) {
  251.                             var before = langs.slice(0,iLang);
  252.                             var after = langs.slice(iLang);
  253.                             langs = before.concat(m[1]).concat(after);
  254.                         }
  255.                     }
  256.                 }
  257.             }
  258.         }
  259.     }
  260.  
  261.     if (langs.length > 0) {
  262.         var pres = document.all.tags("PRE");
  263.         if (pres) {
  264.             for (var iPre = 0; iPre < pres.length; iPre++)
  265.                 initPreElem(pres[iPre]);
  266.         }
  267.  
  268.         if (curLang == null){
  269.             var obj = document.all.obj_cook;
  270.             if (obj && obj.object) {
  271.                 cook = obj;
  272.                 if (obj.getValue("lang.all") != "1") {
  273.                     var lang = obj.getValue("lang");
  274.                     var c = langs.length;
  275.                     for (var i = 0; i != c; ++i) {
  276.                         if (langs[i] == lang) {
  277.                             curLang = langs[i];
  278.                             showAll = false;
  279.                         }
  280.                     }
  281.                 }
  282.             }
  283.  
  284.         }
  285.  
  286.         var iLim = document.body.all.length;
  287.         var head = null;
  288.         for (var i = 0; i < iLim; i++) {
  289.             var elem = document.body.all[i];
  290.             if (elem.tagName.match(/^(P)|(PRE)|([DOU]L)$/))
  291.                 break;
  292.             if (elem.tagName.match(/^H[1-6]$/)) {
  293.                 head = elem;
  294.                 head.insertAdjacentHTML('beforeEnd', '<SPAN CLASS=ilang></SPAN>');
  295.             }
  296.         }
  297.  
  298.         iLang = 0;
  299.         foundA = false;
  300.         while (iLang != langs.length){
  301.             if (langs[iLang]=="A")
  302.                 foundA = true;
  303.             iLang++;
  304.         }
  305.         if (!foundA)
  306.             // don't language button on
  307.             var td = hdr.insertCell(0);
  308.         if (td) {
  309.             // Add the language button to the button bar.
  310.             td.className = "button1";
  311.             td.onkeyup = ieKey;
  312.             td.onkeypress = langMenu;
  313.             td.onclick = langMenu;
  314.             td.innerHTML = '<IMG id=button1 SRC="' + baseUrl + 'Filter1a.gif' + '" ALT="' +
  315.                 L_FilterTip_TEXT + '" BORDER=0 TABINDEX=0>';
  316.  
  317.             // Add the menu.
  318.             var div = '<DIV ID="lang_menu" CLASS=langMenu onkeypress=ieKey><B>' + L_Language_TEXT + '</B><UL>';
  319.             for (var i = 0; i < langs.length; i++)
  320.                 div += '<LI><A HREF="" ONCLICK="chooseLang(this)">' + langs[i] + '</A><BR>';
  321.             div += '<LI><A HREF="" ONCLICK="chooseAll()">' + L_ShowAll_TEXT + '</A></UL></DIV>';
  322.             try{nsbanner.insertAdjacentHTML('afterEnd', div);}
  323.             catch(e){try{scrbanner.insertAdjacentHTML('afterEnd', div);}catch(e){}}
  324.         }
  325.  
  326.         if (!showAll)
  327.             filterLang();
  328.     }
  329. }
  330.  
  331.  
  332. function initPreElem(pre){
  333.     var htm0 = pre.outerHTML;
  334.  
  335.     var reLang = /<span\b[^>]*class="?lang"?[^>]*>/i;
  336.     var iFirst = -1;
  337.     var iSecond = -1;
  338.  
  339.     iFirst = htm0.search(reLang);
  340.     if (iFirst >= 0) {
  341.         iPos = iFirst + 17;
  342.         iMatch = htm0.substr(iPos).search(reLang);
  343.         if (iMatch >= 0)
  344.             iSecond = iPos + iMatch;
  345.     }
  346.  
  347.     if (iSecond < 0) {
  348.         var htm1 = trimPreElem(htm0);
  349.         if (htm1 != htm0) {
  350.             pre.insertAdjacentHTML('afterEnd', htm1);
  351.             pre.outerHTML = "";
  352.         }
  353.     }
  354.     else {
  355.         var rePairs = /<(\w+)\b[^>]*><\/\1>/gi;
  356.  
  357.         var substr1 = htm0.substring(0,iSecond);
  358.         var tags1 = substr1.replace(/>[^<>]+(<|$)/g, ">$1");
  359.         var open1 = tags1.replace(rePairs, "");
  360.         open1 = open1.replace(rePairs, "");
  361.  
  362.         var substr2 = htm0.substring(iSecond);
  363.         var tags2 = substr2.replace(/>[^<>]+</g, "><");
  364.         var open2 = tags2.replace(rePairs, "");
  365.         open2 = open2.replace(rePairs, "");
  366.  
  367.         pre.insertAdjacentHTML('afterEnd', open1 + substr2);
  368.         pre.insertAdjacentHTML('afterEnd', trimPreElem(substr1 + open2));
  369.         pre.outerHTML = "";
  370.     }    
  371. }
  372.  
  373.  
  374. function trimPreElem(htm){
  375.     return htm.replace(/[ \r\n]*((<\/[BI]>)*)[ \r\n]*<\/PRE>/g, "$1</PRE>").replace(
  376.         /\w*<\/SPAN>\w*((<[BI]>)*)\r\n/g, "\r\n</SPAN>$1"
  377.         );
  378. }
  379.  
  380.  
  381. function getBlock(elem){
  382.     while (elem && elem.tagName.match(/^([BIUA]|(SPAN)|(CODE)|(TD))$/))
  383.         elem = elem.parentElement;
  384.     return elem;
  385. }
  386.  
  387.  
  388. function langMenu(){
  389.     bodyOnClick();
  390.     var btn = window.event.srcElement
  391.     if (btn.id=="button1"){
  392.     btn.src = btn.src.replace("a.gif", "c.gif");}
  393.  
  394.     window.event.returnValue = false;
  395.     window.event.cancelBubble = true;
  396.  
  397.     var div = document.all.lang_menu;
  398.     var lnk = window.event.srcElement;
  399.     if (div && lnk) {
  400.         var x = lnk.offsetLeft + lnk.offsetWidth - div.offsetWidth;
  401.         div.style.pixelLeft = (x < 0) ? 0 : x;
  402.         div.style.pixelTop = lnk.offsetTop + lnk.offsetHeight;
  403.         div.style.visibility = "visible";
  404.     }
  405. }
  406.  
  407.  
  408. function chooseLang(item){
  409.     window.event.returnValue = false;
  410.     window.event.cancelBubble = true;
  411.  
  412.     if (item) {
  413.         closeMenu();
  414.         curLang = item.innerText;
  415.         showAll = false;
  416.     }
  417.  
  418.     if (cook) {
  419.         cook.putValue('lang', curLang);
  420.         cook.putValue('lang.all', '');
  421.     }
  422.  
  423.     filterLang();
  424. }
  425.  
  426.  
  427. function chooseAll(){
  428.     window.event.returnValue = false;
  429.     window.event.cancelBubble = true;
  430.  
  431.     closeMenu();
  432.  
  433.     showAll = true;
  434.     if (cook)
  435.         cook.putValue('lang.all', '1');
  436.  
  437.     unfilterLang();
  438. }
  439.  
  440.  
  441. function closeMenu(){
  442.     var div = document.all.lang_menu;
  443.     if (div && div.style.visibility != "hidden") {
  444.         var lnk = document.activeElement;
  445.         if (lnk && lnk.tagName == "A")
  446.             lnk.blur();
  447.  
  448.         div.style.visibility = "hidden";
  449.     }
  450. }
  451.  
  452.  
  453. function getNext(elem){
  454.     for (var i = elem.sourceIndex + 1; i < document.all.length; i++) {
  455.         var next = document.all[i];
  456.         if (!elem.contains(next))
  457.             return next;
  458.     }
  459.     return null;
  460. }
  461.  
  462.  
  463. function filterMatch(text, name){
  464.     var a = text.split(",");
  465.     for (var iTok = 0; iTok < a.length; iTok++) {
  466.         var m = a[iTok].match(/([A-Za-z].*[A-Za-z+#0-9])/);
  467.         if (m && m[1] == name)
  468.             return true;
  469.     }
  470.     return false;
  471. }
  472.  
  473.  
  474. function topicHeading(head){
  475.     try{var iLim = nstext.children.length;
  476.     Section = nstext;}
  477.     catch(e){try{var iLim = scrtext.children.length;
  478.         Section = scrtext;}
  479.         catch(e){var iLim = document.body.children.length;
  480.         Section = document.body;
  481.         }
  482.     }
  483.     var idxLim = head.sourceIndex;
  484.     for (var i = 0; i < iLim; i++) {
  485.         var elem = Section.children[i];
  486.         if (elem.sourceIndex < idxLim) {
  487.             if (elem.tagName.match(/^(P)|(PRE)|([DOU]L)$/))
  488.                 return false;
  489.         }
  490.         else
  491.             break;
  492.     }
  493.     return true;
  494. }
  495.  
  496.  
  497. function filterLang(){
  498.     var spans = document.all.tags("SPAN");
  499.     for (var i = 0; i < spans.length; i++) {
  500.         var elem = spans[i];
  501.         if (elem.className == "lang") {
  502.             var newVal = filterMatch(elem.innerText, curLang) ? "block" : "none";
  503.             var block = getBlock(elem);
  504.             block.style.display = newVal;
  505.             elem.style.display = "none";
  506.  
  507.             if (block.tagName == "DT") {
  508.                 var next = getNext(block);
  509.                 if (next && next.tagName == "DD")
  510.                     next.style.display = newVal;
  511.             }
  512.             else if (block.tagName == "DIV") {
  513.                 block.className = "filtered2";
  514.             }
  515.             else if (block.tagName.match(/^H[1-6]$/)) {
  516.                 if (topicHeading(block)) {
  517.                     if (newVal != "none") {
  518.                         var tag = null;
  519.                         if (block.children && block.children.length) {
  520.                             tag = block.children[block.children.length - 1];
  521.                             if (tag.className == "ilang") {
  522.                                 tag.innerHTML = (newVal == "block") ?
  523.                                     '  [' + curLang + ']' : "";
  524.                             }
  525.                         }
  526.                     }
  527.                 }
  528.                 else {
  529.                     var next = getNext(block);
  530.                     while (next && !next.tagName.match(/^(H[1-6])$/)) {
  531.                         if (next.tagName =="DIV"){
  532.                             if (next.className.toUpperCase() != "TABLEDIV") break;
  533.                         }
  534.                         next.style.display = newVal;
  535.                         next = getNext(next);
  536.                     }
  537.                 }
  538.             }
  539.         }
  540.         else if (elem.className == "ilang") {
  541.             var block = getBlock(elem);
  542.             if (block.tagName == "H1")
  543.                 elem.innerHTML = '  [' + curLang + ']';
  544.         }
  545.     }
  546.  
  547.     if (ie4) {
  548.         document.body.style.display = "none";
  549.         document.body.style.display = "block";
  550.     }
  551.     resizeBan();
  552. }
  553.  
  554.  
  555. function unfilterLang(name){
  556.     var spans = document.all.tags("SPAN");
  557.     for (var i = 0; i < spans.length; i++) {
  558.         var elem = spans[i];
  559.         if (elem.className == "lang") {
  560.             var block = getBlock(elem);
  561.             block.style.display = "block";
  562.             elem.style.display = "inline";
  563.  
  564.             if (block.tagName == "DT") {
  565.                 var next = getNext(block);
  566.                 if (next && next.tagName == "DD")
  567.                     next.style.display = "block";
  568.             }
  569.             else if (block.tagName == "DIV") {
  570.                 block.className = "filtered";
  571.             }
  572.             else if (block.tagName.match(/^H[1-6]$/)) {
  573.                 if (topicHeading(block)) {
  574.                     var tag = null;
  575.                     if (block.children && block.children.length) {
  576.                         tag = block.children[block.children.length - 1];
  577.                         if (tag && tag.className == "ilang")
  578.                             tag.innerHTML = "";
  579.                     }
  580.                 }
  581.                 else {
  582.                     var next = getNext(block);
  583.                     while (next && !next.tagName.match(/^(H[1-6])$/)) {
  584.                         if (next.tagName =="DIV"){
  585.                             if (next.className.toUpperCase() != "TABLEDIV") break;
  586.                         }
  587.                         next.style.display = "block";
  588.                         next = getNext(next);
  589.                     }
  590.                 }
  591.             }
  592.         }
  593.         else if (elem.className == "ilang") {
  594.             elem.innerHTML = "";
  595.         }
  596.     }
  597.     resizeBan();
  598. }
  599.  
  600.  
  601. // ****************************************************************************
  602. // *                      Reftips (parameter popups)                          *
  603. // ****************************************************************************
  604.  
  605. function initReftips(){
  606.     var DLs = document.all.tags("DL");
  607.     var PREs = document.all.tags("PRE");
  608.     if (DLs && PREs) {
  609.         var iDL = 0;
  610.         var iPRE = 0;
  611.         var iSyntax = -1;
  612.         for (var iPRE = 0; iPRE < PREs.length; iPRE++) {
  613.             if (PREs[iPRE].className == "syntax") {
  614.                 while (iDL < DLs.length && DLs[iDL].sourceIndex < PREs[iPRE].sourceIndex)
  615.                     iDL++;            
  616.                 if (iDL < DLs.length) {
  617.                     initSyntax(PREs[iPRE], DLs[iDL]);
  618.                     iSyntax = iPRE;
  619.                 }
  620.                 else
  621.                     break;
  622.             }
  623.         }
  624.  
  625.         if (iSyntax >= 0) {
  626.             var last = PREs[iSyntax];
  627.             if (last.parentElement.tagName == "DIV") last = last.parentElement;
  628.             last.insertAdjacentHTML('afterEnd','<DIV ID=reftip CLASS=reftip STYLE="position:absolute;visibility:hidden;overflow:visible;"></DIV>');
  629.         }
  630.     }
  631. }
  632.  
  633.  
  634. function initSyntax(pre, dl){
  635.     var strSyn = pre.outerHTML;
  636.     var ichStart = strSyn.indexOf('>', 0) + 1;
  637.     var terms = dl.children.tags("DT");
  638.     if (terms) {
  639.         for (var iTerm = 0; iTerm < terms.length; iTerm++) {
  640.             var words = terms[iTerm].innerText.replace(/\[.+\]/g, " ").replace(/,/g, " ").split(" ");
  641.             var htm = terms[iTerm].innerHTML;
  642.             for (var iWord = 0; iWord < words.length; iWord++) {
  643.                 var word = words[iWord];
  644.  
  645.                 if (word.length > 0 && htm.indexOf(word, 0) < 0)
  646.                     word = word.replace(/:.+/, "");
  647.  
  648.                 if (word.length > 0) {
  649.                     var ichMatch = findTerm(strSyn, ichStart, word);
  650.                     while (ichMatch > 0) {
  651.                         var strTag = '<A HREF="" ONCLICK="showTip(this)" CLASS="synParam">' + word + '</A>';
  652.  
  653.                         strSyn =
  654.                             strSyn.slice(0, ichMatch) +
  655.                             strTag +
  656.                             strSyn.slice(ichMatch + word.length);
  657.  
  658.                         ichMatch = findTerm(strSyn, ichMatch + strTag.length, word);
  659.                     }
  660.                 }
  661.             }
  662.         }
  663.     }
  664.  
  665.     // Replace the syntax block with our modified version.
  666.     pre.outerHTML = strSyn;
  667. }
  668.  
  669.  
  670. function findTerm(strSyn, ichPos, strTerm)
  671. {
  672.     var ichMatch = strSyn.indexOf(strTerm, ichPos);
  673.     while (ichMatch >= 0) {
  674.         var prev = (ichMatch == 0) ? '\0' : strSyn.charAt(ichMatch - 1);
  675.         var next = strSyn.charAt(ichMatch + strTerm.length);
  676.         if (!isalnum(prev) && !isalnum(next) && !isInTag(strSyn, ichMatch)) {
  677.             var ichComment = strSyn.indexOf("/*", ichPos);
  678.             while (ichComment >= 0) {
  679.                 if (ichComment > ichMatch) { 
  680.                     ichComment = -1;
  681.                     break; 
  682.                 }
  683.                 var ichEnd = strSyn.indexOf("*/", ichComment);
  684.                 if (ichEnd < 0 || ichEnd > ichMatch)
  685.                     break;
  686.                 ichComment = strSyn.indexOf("/*", ichEnd);
  687.             }
  688.             if (ichComment < 0) {
  689.                 ichComment = strSyn.indexOf("//", ichPos);
  690.                 var newPos = 0;
  691.                 if (ichComment >= 0) {
  692.                     while (isInTag(strSyn, ichComment)) { //checks to see if the comment is in a tag (and thus part of a URL)
  693.                         newPos = ichComment + 1;
  694.                         ichComment = strSyn.indexOf("//", newPos);
  695.                         if (ichComment < 0) 
  696.                             break;
  697.                     }
  698.                     while (ichComment >= 0) {
  699.                         if (ichComment > ichMatch) {
  700.                             ichComment = -1;
  701.                             break; 
  702.                         }
  703.                         var ichEnd = strSyn.indexOf("\n", ichComment);
  704.                         if (ichEnd < 0 || ichEnd > ichMatch)
  705.                             break;
  706.                         ichComment = strSyn.indexOf("//", ichEnd);
  707.                     }
  708.                 }
  709.             }
  710.             if (ichComment < 0)
  711.                 break;
  712.         }
  713.         ichMatch = strSyn.indexOf(strTerm, ichMatch + strTerm.length);
  714.     }
  715.     return ichMatch;
  716. }
  717.  
  718.  
  719. function isInTag(strHtml, ichPos)
  720. {
  721.     return strHtml.lastIndexOf('<', ichPos) >
  722.         strHtml.lastIndexOf('>', ichPos);
  723. }
  724.  
  725.  
  726. function isalnum(ch){
  727.     return ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || (ch == '_') || (ch == '-'));
  728. }
  729.  
  730.  
  731. function showTip(link){
  732.     bodyOnClick();
  733.     var tip = document.all.reftip;
  734.     if (!tip || !link)
  735.         return;
  736.  
  737.     window.event.returnValue = false;
  738.     window.event.cancelBubble = true;
  739.  
  740.     // Hide the tip if necessary and initialize its size.
  741.     tip.style.visibility = "hidden";
  742.     tip.style.pixelWidth = 260;
  743.     tip.style.pixelHeight = 24;
  744.  
  745.     // Find the link target.
  746.     var term = null;
  747.     var def = null;
  748.     var DLs = document.all.tags("DL");
  749.     for (var iDL = 0; iDL < DLs.length; iDL++) {
  750.         if (DLs[iDL].sourceIndex > link.sourceIndex) {
  751.             var dl = DLs[iDL];
  752.             var iMax = dl.children.length - 1;
  753.             for (var iElem = 0; iElem < iMax; iElem++) {
  754.                 var dt = dl.children[iElem];
  755.                 if (dt.tagName == "DT" && dt.style.display != "none") {
  756.                     if (findTerm(dt.innerText, 0, link.innerText) >= 0) {
  757.                         var dd = dl.children[iElem + 1];
  758.                         if (dd.tagName == "DD") {
  759.                             term = dt;
  760.                             def = dd;
  761.                         }
  762.                         break;
  763.                     }
  764.                 }
  765.             }
  766.             break;
  767.         }
  768.     }
  769.  
  770.     if (def) {
  771.         window.linkElement = link;
  772.         window.linkTarget = term;
  773.         tip.innerHTML = '<DL><DT>' + term.innerHTML + '</DT><DD>' + def.innerHTML + '</DD></DL>';
  774.         window.setTimeout("moveTip()", 0);
  775.     }
  776. }
  777.  
  778.  
  779. function jumpParam(){
  780.     hideTip();
  781.  
  782.     window.linkTarget.scrollIntoView();
  783.     document.body.scrollLeft = 0;
  784.  
  785.     flash(3);
  786. }
  787.  
  788.  
  789. function flash(c){
  790.     window.linkTarget.style.background = (c & 1) ? "#CCCCCC" : "";
  791.     if (c)
  792.         window.setTimeout("flash(" + (c-1) + ")", 200);
  793. }
  794.  
  795.  
  796. function moveTip(){
  797.     var tip = document.all.reftip;
  798.     var link = window.linkElement;
  799.     if (!tip || !link)
  800.         return; //error
  801.  
  802.     var w = tip.offsetWidth;
  803.     var h = tip.offsetHeight;
  804.  
  805.     if (w > tip.style.pixelWidth) {
  806.         tip.style.pixelWidth = w;
  807.         window.setTimeout("moveTip()", 0);
  808.         return;
  809.     }
  810.  
  811.     var maxw = document.body.clientWidth-20;
  812.     var maxh = document.body.clientHeight-200;
  813.  
  814.     if (h > maxh) {
  815.         if (w < maxw) {
  816.             w = w * 3 / 2;
  817.             tip.style.pixelWidth = (w < maxw) ? w : maxw;
  818.             window.setTimeout("moveTip()", 0);
  819.             return;
  820.         }
  821.     }
  822.  
  823.     var x,y;
  824.  
  825.     var linkLeft = link.offsetLeft - document.body.scrollLeft;
  826.     var linkRight = linkLeft + link.offsetWidth;
  827.  
  828.     var linkTop = link.offsetTop - document.body.scrollTop;
  829.     var linkBottom = linkTop + link.offsetHeight;
  830.  
  831.     var cxMin = link.offsetWidth - 24;
  832.     if (cxMin < 16)
  833.         cxMin = 16;
  834.  
  835.     if (linkLeft + cxMin + w <= maxw) {
  836.         x = maxw - w;
  837.         if (x > linkRight + 8)
  838.             x = linkRight + 8;
  839.         y = maxh - h;
  840.         if (y > linkTop)
  841.             y = linkTop;
  842.     }
  843.     else if (linkBottom + h <= maxh) {
  844.         x = maxw - w;
  845.         if (x < 0)
  846.             x = 0;
  847.         y = linkBottom;
  848.     }
  849.     else if (w <= linkRight - cxMin) {
  850.         x = linkLeft - w - 8;
  851.         if (x < 0)
  852.             x = 0;
  853.         y = maxh - h;
  854.         if (y > linkTop)
  855.             y = linkTop;
  856.     }
  857.     else if (h <= linkTop) {
  858.         x = maxw - w;
  859.         if (x < 0)
  860.             x = 0;
  861.         y = linkTop - h;
  862.     }
  863.     else if (w >= maxw) {
  864.         x = 0;
  865.         y = linkBottom;
  866.     }
  867.     else {
  868.         w = w * 3 / 2;
  869.         tip.style.pixelWidth = (w < maxw) ? w : maxw;
  870.         window.setTimeout("moveTip()", 0);
  871.         return;
  872.     }
  873.     
  874.     link.style.background = "#CCCCCC";
  875.     tip.style.pixelLeft = x + document.body.scrollLeft;
  876.     tip.style.pixelTop = y + document.body.scrollTop;
  877.     tip.style.visibility = "visible";
  878. }
  879.  
  880. function hideTip(){
  881.     if (window.linkElement) {
  882.         window.linkElement.style.background = "";
  883.         window.linkElement = null;
  884.     }
  885.  
  886.     var tip = document.all.reftip;
  887.     if (tip) {
  888.         tip.style.visibility = "hidden";
  889.         tip.innerHTML = "";
  890.     }
  891. }
  892.  
  893.  
  894. function beginsWith(s1, s2){
  895.     // Does s1 begin with s2?
  896.     return s1.substring(0, s2.length) == s2;
  897. }
  898.  
  899.  
  900. // ****************************************************************************
  901. // *                           See Also popups                                *
  902. // ****************************************************************************
  903.  
  904. function initSeeAlso(){
  905.     var hdr = document.all.hdr;
  906.     if (!hdr)
  907.         return;
  908.  
  909.     var divS = new String;
  910.     var divR = new String;
  911.     var heads = document.all.tags("H4");
  912.     if (heads) {
  913.         for (var i = 0; i < heads.length; i++) {
  914.             var head = heads[i];
  915.             var txt = head.innerText;
  916.             if (beginsWith(txt, L_SeeAlso_TEXT) || beginsWith(txt, US_See_Also)) {
  917.                 divS += head.outerHTML;
  918.                 var next = getNext(head);
  919.                 while (next && !next.tagName.match(/^(H[1-4])|(DIV)$/)) {
  920.                     divS += next.outerHTML;
  921.                     next = getNext(next);
  922.                 }
  923.             }
  924.             else if (beginsWith(txt, L_Requirements_TEXT) || beginsWith(txt, US_Requirements) || beginsWith(txt, L_QuickInfo_TEXT) || beginsWith(txt, US_QuickInfo)) {
  925.                 divR += head.outerHTML;
  926.                 var next = getNext(head);
  927.                 var isValid = true;
  928.                 while (isValid){
  929.                     if (next && !next.tagName.match(/^(H[1-4])$/)){
  930.                         if (next.tagName == "DIV" && next.outerHTML.indexOf("tablediv")==-1)
  931.                                 isValid = false;
  932.                         if (isValid){
  933.                             divR += next.outerHTML;
  934.                             next = getNext(next);
  935.                         }
  936.                     }
  937.                     else
  938.                         isValid = false;
  939.                 }
  940.             }
  941.         }
  942.     }
  943.  
  944.     var pos = getNext(hdr.parentElement);
  945.     if (pos) {
  946.         if (divR != "") {
  947.             divR = '<DIV ID=rpop CLASS=sapop onkeypress=ieKey>' + divR + '</DIV>';
  948.             var td = hdr.insertCell(0);
  949.             if (td) {
  950.                 td.className = "button1";
  951.                 td.onclick = showRequirements;
  952.                 td.onkeyup = ieKey;
  953.                 td.onkeypress = showRequirements;
  954.                 td.innerHTML = '<IMG id=button1 SRC="' + baseUrl + 'Requirements1a.gif' + '" ALT="' + L_Requirements_TEXT + '" BORDER=0 TABINDEX=0>';
  955.                 if (advanced)
  956.                     try{nsbanner.insertAdjacentHTML('afterEnd', divR);}
  957.                     catch(e){try{scrbanner.insertAdjacentHTML('afterEnd', divR);}catch(e){}}
  958.                 else
  959.                     document.body.insertAdjacentHTML('beforeEnd', divR);
  960.             }
  961.         }
  962.         if (divS != "") {
  963.             divS = '<DIV ID=sapop CLASS=sapop onkeypress=ieKey>' + divS + '</DIV>';
  964.             var td = hdr.insertCell(0);
  965.             if (td) {
  966.                 td.className = "button1";
  967.                 td.onclick = showSeeAlso;
  968.                 td.onkeyup = ieKey;
  969.                 td.onkeypress = showSeeAlso;
  970.                 td.innerHTML = '<IMG id=button1 SRC="' + baseUrl + 'SeeAlso1a.gif' + '" ALT="' + L_SeeAlso_TEXT + '" BORDER=0 TABINDEX=0>';
  971.                 if (advanced)
  972.                     try{nsbanner.insertAdjacentHTML('afterEnd', divS);}
  973.                     catch(e){try{scrbanner.insertAdjacentHTML('afterEnd', divS);}catch(e){}}
  974.                 else
  975.                     document.body.insertAdjacentHTML('beforeEnd', divS);
  976.             }
  977.         }
  978.     }
  979. }
  980.  
  981. function resetButtons(){
  982.     //unclick buttons...
  983.     var btns = document.all.button1;
  984.     if (btns) {
  985.         if (btns.src!=null) btns.src=btns.src.replace("c.gif", "a.gif"); //if there is only one button.
  986.         for (var i = 0; i < btns.length; i++){
  987.             btns[i].src = btns[i].src.replace("c.gif", "a.gif");
  988.         }
  989.     }
  990. }
  991.  
  992. function showSeeAlso(){
  993.     bodyOnClick();
  994.     var btn = window.event.srcElement
  995.     if (btn.id=="button1"){
  996.     btn.src = btn.src.replace("a.gif", "c.gif");}
  997.  
  998.     window.event.returnValue = false;
  999.     window.event.cancelBubble = true;
  1000.  
  1001.     var div = document.all.sapop;
  1002.     var lnk = window.event.srcElement;
  1003.  
  1004.     if (div && lnk) {
  1005.         div.style.pixelTop = lnk.offsetTop + lnk.offsetHeight;
  1006.         div.style.visibility = "visible";
  1007.     }
  1008. }
  1009.  
  1010.  
  1011. function showRequirements(){
  1012.     bodyOnClick();
  1013.     var btn = window.event.srcElement
  1014.     if (btn.id=="button1"){
  1015.     btn.src = btn.src.replace("a.gif", "c.gif");}
  1016.  
  1017.     window.event.returnValue = false;
  1018.     window.event.cancelBubble = true;
  1019.  
  1020.     var div = document.all.rpop;
  1021.     var lnk = window.event.srcElement;
  1022.  
  1023.     if (div && lnk) {
  1024.         div.style.pixelTop = lnk.offsetTop + lnk.offsetHeight;
  1025.         div.style.visibility = "visible";
  1026.     }
  1027. }
  1028.  
  1029.  
  1030. function hideSeeAlso(){
  1031.     var div = document.all.sapop;
  1032.     if (div)
  1033.         div.style.visibility = "hidden";
  1034.  
  1035.     var div = document.all.rpop;
  1036.     if (div)
  1037.         div.style.visibility = "hidden";
  1038. }
  1039.  
  1040.  
  1041. // ****************************************************************************
  1042. // *                             Expand-Collapse                              *
  1043. // ****************************************************************************
  1044.  
  1045. function makeExpandable(title, level){
  1046.     if (title!="")document.write("<a href=\"\#\" onClick='callExpand()' id=\"ExPand\" Class=\"expandLink" + level + "\"><IMG CLASS=\"ExPand\" SRC=\"" + baseUrl + "coe.gif\" HEIGHT=9 WIDTH=9 ALT=\"" + L_ExColl_TEXT + "\" BORDER=0> " + title + "</a><BR><div CLASS=\"expandBody" + level + "\">");
  1047.     else document.write("<a href=\"\#\" id=\"ExPandAll\" onClick='callExpandAll()' Class=\"expandLink" + level + "\"><IMG CLASS=\"ExPandAll\" SRC=\"" + baseUrl + "coe.gif\" HEIGHT=9 WIDTH=9 ALT=\"" + L_ExColl_TEXT + "\" BORDER=0> " + L_ExpandAll_TEXT + "</A>");
  1048. }
  1049.  
  1050. function getImage(){
  1051.     for (var a = 0; a < 7; a++){
  1052.           if ((e.tagName != 'A') && (e.parentElement != null)){e = e.parentElement;}
  1053.         var elemImg = e;
  1054.         if(elemImg.tagName == 'A'){elemImg = e.all.tags('IMG')(0); break;}}
  1055. return elemImg;}
  1056.  
  1057. function callExpand(){
  1058. //DO EXPAND/COLLAPSE
  1059.     e = window.event.srcElement;
  1060.  
  1061.     //PREVENTS NAVIGATION ON HREF TAGS
  1062.     event.returnValue = false;
  1063.  
  1064.     //FIND THE EXPAND/COLLAPSE PORTION AND ASCERTAIN BLOCK VS NONE
  1065.     var theDiv = GrabtheExpandDiv(e);
  1066.         
  1067.     //THIS PART WRITES THE PROPER IMAGE BESIDE THE TEXT
  1068.     if (theDiv.style.display == 'block'){
  1069.         var theImg = getImage(e);
  1070.         theImg.src = baseUrl + "coe.gif";
  1071.         theDiv.style.display = "none";}
  1072.     else {
  1073.         var theImg = getImage(e);
  1074.         theImg.src = baseUrl + "coc.gif";
  1075.         theDiv.style.display = "block";}
  1076. return;}
  1077.  
  1078. function GrabtheExpandDiv(e){
  1079. //FIND AREA TO EXPAND/COLLAPSE
  1080.     var theExpandDiv;
  1081.     for (var a = 0; a < 7; a++){
  1082.         var theTag = e.sourceIndex + e.children.length + a;
  1083.         theExpandDiv= document.all(theTag);
  1084.          if (((theExpandDiv.tagName == 'DIV') && ((theExpandDiv.className.toLowerCase().indexOf("expandbody")!=-1))) || theTag == document.all.length){break;}}
  1085. return theExpandDiv;
  1086. }
  1087.  
  1088. function callExpandAll(){
  1089.     e = window.event.srcElement;
  1090.     //PREVENTS NAVIGATION ON HREF TAGS
  1091.     event.returnValue = false;
  1092.     if (e.tagName=="IMG") e = e.parentElement;
  1093.     //Expand or Collapse?
  1094.     if (e.innerHTML.indexOf(L_ExpandAll_TEXT) != -1){eOrC="block"}else{eOrC="none"}
  1095.     if (eOrC=="block"){
  1096.         e.innerHTML="<IMG CLASS='ExPand' SRC=\"" + baseUrl + "coc.gif\" HEIGHT='9' WIDTH='9' ALT='" + L_ExColl_TEXT + "' BORDER='0'> " + L_CollapseAll_TEXT;}
  1097.     else{
  1098.         e.innerHTML="<IMG CLASS='ExPand' SRC=\"" + baseUrl + "coe.gif\" HEIGHT='9' WIDTH='9' ALT='" + L_ExColl_TEXT + "' BORDER='0'> " + L_ExpandAll_TEXT;}
  1099.     for (var a = 0; a < document.all.length; a++){ 
  1100.         e=document.all[a];
  1101.  
  1102.         if (e.id.indexOf('ExPand') != -1){
  1103.  
  1104.             if (e.id.indexOf('ExPandAll') == -1){
  1105.  
  1106.             var theDiv = GrabtheExpandDiv(e);
  1107.             if (eOrC == 'none'){
  1108.                 theImg = getImage(e);
  1109.                 theImg.src = baseUrl + "coe.gif";
  1110.                 theDiv.style.display = eOrC;}
  1111.             else {
  1112.                 theImg = getImage(e);
  1113.                 theImg.src = baseUrl + "coc.gif";
  1114.                 theDiv.style.display = eOrC;}
  1115.             }
  1116.         }
  1117.     }
  1118. return;}
  1119.  
  1120.  
  1121. // ****************************************************************************
  1122. // *                            Graphic Animation                             *
  1123. // ****************************************************************************
  1124.  
  1125. /* function insertAnimation(name) {
  1126.     document.write("<input type=\"image\" src=\"" + baseUrl + "AnimButton1.gif\" onClick=\"changeToAnimate('" + name +".gif', '" + name + "');\" onMouseDown=\"src='" + baseUrl + "AnimButton2.gif';\" onMouseUp=\"src='" + baseUrl + "AnimButton1.gif';\"> " + L_Animation_Text + "<br><br><img name=\"" + name + "\" src=\"" + name + "1.gif\">");
  1127.     }
  1128.  
  1129.  
  1130. function changeToAnimate(imgSRC, imgName) {
  1131.     document[imgName].src = imgSRC;
  1132.     }
  1133.  
  1134.  
  1135. To Support New Animation code uncomment these and delete the others
  1136. */
  1137.  
  1138. function insertAnimation(name, number) {
  1139.     imgArray[number].src = name + ".gif";
  1140.     document.write("<input type=\"image\" src=\"" + baseUrl + "AnimButton1.gif\" onClick=\"changeToAnimate('" + name + "', " + number + ");\" onMouseDown=\"src='" + baseUrl + "AnimButton2.gif';\" onMouseUp=\"src='" + baseUrl + "AnimButton1.gif';\"> " + L_Animation_Text + "<br><br><img name=\"" + name + "\" src=\"" + name + "1.gif\">");
  1141.     }
  1142.  
  1143.  
  1144. function changeToAnimate(imgName, number) {
  1145.     document[imgName].src = imgArray[number].src;
  1146.     }
  1147.  
  1148.  
  1149.  
  1150. // ****************************************************************************
  1151. // *                           Nonscrolling region                            *
  1152. // ****************************************************************************
  1153.  
  1154. function resizeBan(){
  1155. //resizes nonscrolling banner
  1156.     if (document.body.clientWidth==0) return;
  1157.     var oBanner= document.all.item("nsbanner");
  1158.     var oText= document.all.item("nstext");
  1159.     if (oText == null) return;
  1160.     var oBannerrow1 = document.all.item("bannerrow1");
  1161.     var oTitleRow = document.all.item("titlerow");
  1162.     if (oBannerrow1 != null){
  1163.         var iScrollWidth = bodyID.scrollWidth;
  1164.         oBannerrow1.style.marginRight = 0 - iScrollWidth;
  1165.     }
  1166.     if (oTitleRow != null){
  1167.         oTitleRow.style.padding = "0px 10px 0px 22px; ";
  1168.     }
  1169.     if (oBanner != null){
  1170. //Uncomment the following 4 lines for slingshot
  1171. //        if (document.all.tags('iframe') !=null){
  1172. //        document.body.scroll = "yes"
  1173. //        return; 
  1174. //    }
  1175.         document.body.scroll = "no"
  1176.         oText.style.overflow= "auto";
  1177.          oBanner.style.width= document.body.offsetWidth-2;
  1178.         oText.style.paddingRight = "20px"; // Width issue code
  1179.         oText.style.width= document.body.offsetWidth-4;
  1180.         oText.style.top=0;  
  1181.         if (document.body.offsetHeight > oBanner.offsetHeight)
  1182.                 oText.style.height= document.body.offsetHeight - (oBanner.offsetHeight+4) 
  1183.         else oText.style.height=0
  1184.     }    
  1185.     try{nstext.setActive();} //allows scrolling from keyboard as soon as page is loaded. Only works in IE 5.5 and above.
  1186.     catch(e){}
  1187.     resetButtons();
  1188.  
  1189.  
  1190. function set_to_print(){
  1191. //breaks out of divs to print
  1192.  
  1193.     var i;
  1194.  
  1195.     if (window.text)document.all.text.style.height = "auto";
  1196.             
  1197.     for (i=0; i < document.all.length; i++){
  1198.         if (document.all[i].tagName == "BODY") {
  1199.             document.all[i].scroll = "yes";
  1200.             }
  1201.         if (document.all[i].id == "nsbanner") {
  1202.             document.all[i].style.margin = "0px 0px 0px 0px";
  1203.             }
  1204.         if (document.all[i].id == "nstext") {
  1205.             document.all[i].style.overflow = "visible";
  1206.             document.all[i].style.top = "5px";
  1207.             document.all[i].style.width = "100%";
  1208.             document.all[i].style.padding = "0px 10px 0px 30px";
  1209.             }
  1210. /*        if (document.all[i].tagName == "A") {
  1211.             document.all[i].outerHTML = "<A HREF=''>" + document.all[i].innerHTML + "</a>";
  1212.             }
  1213. */
  1214.         }
  1215.  
  1216. }
  1217.  
  1218.  
  1219. function reset_form(){
  1220. //returns to the div nonscrolling region after print
  1221.  
  1222.      document.location.reload();
  1223. }
  1224.  
  1225.  
  1226. // ****************************************************************************
  1227. // *                        Feedback & other footer links                     *
  1228. // ****************************************************************************
  1229.  
  1230. function writefeedbacklink(){
  1231.     //writes feedback link
  1232.     msdnid = arguments[0];
  1233.     contextid = arguments[1];
  1234.     topictitle = arguments[2];
  1235.     href = "http://beta.visualstudio.net/feedback.asp?feedback=doc&msdnid="+msdnid+"&contextid="+contextid+"&topictitle="+topictitle;
  1236.     document.writeln("<a href="+href+">"+L_FeedbackLink_TEXT+"</a>");
  1237. }
  1238.  
  1239.  
  1240. function writemessagelink(){
  1241.     //Writes jump to PSS web site redirector
  1242.     //code tbd
  1243.     //Use L_MessageLink_TEXT variable from Localization Variables located at top of script.
  1244.     msdnid = arguments[0];
  1245.     href = "http://www.microsoft.com/contentredirect.asp?prd=vs&pver=7.0&id="+msdnid;
  1246.     document.writeln("<a href="+href+">"+L_MessageLink_TEXT+"</a>");
  1247. }
  1248.  
  1249.  
  1250. function writemailtolink(){
  1251.     //writes feedback link
  1252.     emailalias = arguments[0];
  1253.     contextid = arguments[1];
  1254.     topictitle = arguments[2];
  1255.  
  1256.     href = "mailto:"+emailalias+"?subject=Feedback%20on%20topic%20-%20"+topictitle+",%20URL%20-%20"+contextid;
  1257.     document.writeln("<a href="+href+">"+L_MailToLink_TEXT+"</a>");
  1258. }
  1259.  
  1260.  
  1261. // ****************************************************************************
  1262. // *                       NavFailPage Parameter Insertion                    *
  1263. // ****************************************************************************
  1264.  
  1265. function navfailpageparam() {
  1266.     var keyString = "keywords=";
  1267.     var idxString = "index=";
  1268.     var urlString = "url=";
  1269.     var query = window.location.search;
  1270.     var j = 0;
  1271.     var delim;
  1272.     var i = query.indexOf(keyString);
  1273.  
  1274.     document.write("<p>" + L_Keyword_TEXT + " <span id=keywordsSpan></span><br>");
  1275.     document.write(L_IndexMoniker_TEXT + " <span id=indexSpan></span><br>");
  1276.     document.write(L_URL_TEXT + " <span id=urlSpan></span></p>");
  1277.  
  1278.     if (i >= 0) {
  1279.         i += keyString.length;
  1280.         delim = query.charAt(i);
  1281.         j = query.indexOf(delim, i+1);
  1282.         if (j > 0) keywordsSpan.innerText = query.substring(i, j+1);
  1283.     }
  1284.  
  1285.     i = query.indexOf(idxString);
  1286.     if (i >= 0) {
  1287.         i += idxString.length;
  1288.         delim = query.charAt(i);
  1289.         j = query.indexOf(delim, i+1);
  1290.         if (j > 0) indexSpan.innerText = query.substring(i, j+1);
  1291.     }
  1292.  
  1293.     i = query.indexOf(urlString);
  1294.     if (i >= 0) {
  1295.         i += urlString.length;
  1296.         delim = query.charAt(i);
  1297.         j = query.indexOf(delim, i+1);
  1298.         if (j > 0) urlSpan.innerText = query.substring(i, j+1);
  1299.     }
  1300. }
  1301.  
  1302.